package enumdemo;

public class EnumerationDemo {

    public static void main(String[] args) {
        Colors color1 = Colors.BLUE;

        switch (color1) {
            case RED:
                System.out.println("颜色是红色");
                break;
            case GREEN:
                System.out.println("颜色是绿色");
                break;
            case BLUE:
                System.out.println("颜色是蓝色");
                break;
            case BLACK:
                System.out.println("颜色是黑色");
                break;
            case WHITE:
                System.out.println("颜色是白色");
                break;
            default:
                System.out.println("其它颜色");
                break;
        }


        Colors color2 = Colors.RED;
        Colors color3 = Colors.WHITE;
        System.out.println(color2.ordinal());
        System.out.println(color3.ordinal());
    }
}
